﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Assignment1
{
    public partial class TestA1P1Service : Form
    {
        public TestA1P1Service()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            // create a proxy
            ConnerA1P1Service.Service1Client wcf_proxy =
                new ConnerA1P1Service.Service1Client();

            // pi test
            double pi = wcf_proxy.PiValue();

            // abs tests
            int test1 = wcf_proxy.absValue(27);
            int test2 = wcf_proxy.absValue(-27);

            // add tests
            double add_test = wcf_proxy.add(2, 2);

            // subtract test
            double sub_test = wcf_proxy.subtract(2, 2);

            // write results to the output window
            _output.AppendText("Pi = " + pi.ToString() + "\r\n");
            _output.AppendText("ABS test results: ( in: 27 | out: " + 
                test1.ToString() +
                "), (in: -27 | out: " +
                test2.ToString() + ")\r\n");
            _output.AppendText("Add Test results: (2 + 2) = " + add_test.ToString() + "\r\n");
            _output.AppendText("Subtract Test REsults: (2 - 2) = " + sub_test.ToString() + "\r\n");

            wcf_proxy.Close();
        }
    }
}
